<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no" />
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#wrap{
				width: 100px;
				height: 100px;
				padding: 100px;
				margin: 100px auto;
				border: 1px solid;
				perspective: 200px;
			}
			#box{
				position: relative;
				width: 100px;
				height: 100px;
				transform-style: preserve-3d;
				transition: 20s;
				transform: translateZ(-50px) rotateX(0deg);
			}
			#box div{
				position: absolute;
				left: 0;
				top: 0;
				width: 100px;
				height: 100px;
				text-align: center;
				line-height: 100px;
				font-size: 50px;
				background: pink;
			}
			#box div:nth-of-type(1){
				transform: rotateY(0deg) translateZ(50px);
			}
			#box div:nth-of-type(2){
				transform: rotateY(180deg) translateZ(50px);
			}
			#box div:nth-of-type(3){
				transform: rotateY(270deg) translateZ(50px);
			}
			#box div:nth-of-type(4){
				transform: rotateY(90deg) translateZ(50px);
			}
			#box div:nth-of-type(5){
				transform: rotateX(90deg) translateZ(50px);
			}
			#box div:nth-of-type(6){
				transform: rotateX(270deg) translateZ(50px);
			}
			
			
			
			#wrap:hover #box{
				transform:translateZ(-50px) rotateX(360deg) ;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div id="box">
				<div>前</div>
				<div>后</div>
				<div>左</div>
				<div>右</div>
				<div>上</div>
				<div>下</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		document.addEventListener("touchstart",function(ev){
			ev=ev||event;
			ev.preventDefault();
		})
		
	</script>
</html>
